package com.hdaccp.shuiguoD.service.impl;

import com.hdaccp.shuiguoD.dao.GongyingDao;
import com.hdaccp.shuiguoD.entity.Gongying;
import com.hdaccp.shuiguoD.service.GongyingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GongyingServiceImpl implements GongyingService {
    @Autowired
    private GongyingDao gongyingDao;

    @Override
    public List<Gongying> getAll(){ return gongyingDao.queryAll();}

    @Override
    public long findTotalCount(String gname) {
        return gongyingDao.getTotalCount(gname);
    }

    @Override
    public List<Gongying> findAll(String gname, int offset, int limit) {
        return gongyingDao.query(gname,offset,limit);
    }

    @Override
    public int delte(int gid) {
        return gongyingDao.delet(gid);
    }

    @Override
    public int zj(Gongying gongyinginfo) {
        return gongyingDao.add(gongyinginfo);
    }

    @Override
    public int update(Gongying gongyinginfo) {
        return gongyingDao.update(gongyinginfo);
    }

    //根据ID查询
    @Override
    public Gongying queryById(int gid) {
        return gongyingDao.queryById(gid);
    }

}

